<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="com.crm.util.SESSION"%>
<%@ page import="com.crm.po.Users"%>
<%
String path = request.getContextPath();
Object obj = request.getSession(true).getAttribute(SESSION.USER_SESSION_KEY);
Users users = null;
if(obj != null){
	users = (Users) obj;
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>  
    <title>CRM</title>
    <link rel="icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
    <link rel="shortcut icon" mce_href="<%=path%>/images/title_logo.ico" href="<%=path%>/images/title_logo.ico" type="image/x-ico"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/crm.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui1.3.2/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path%>/js/easyui1.3.2/themes/icon.css">	
	<script type="text/javascript" src="<%=path%>/js/easyui1.3.2/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/easyui1.3.2/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/easyui1.3.2/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="<%=path%>/js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript">

	//初始化采购树形菜单
	$(function(){
		var url = '<%=path%>/menu.do';
		$('#fp2Tree').tree({
			url: url + '?method=getTree&menutype=fp2',
			onClick:function(node){
				if(node.id != ''){
					var src = "fp2list.jsp?treeid=" + node.id;
					$("#mainFrame").attr("src", src);
				}
			},
			onLoadSuccess:function(){
				$('#fp2Tree').tree("expandAll");
				$("#fp2Tree li:eq(0)").find("div").addClass("tree-node-selected");   //设置第一个节点高亮  
				var fn = $('#fp2Tree').tree("getRoot");
				var firstSrc = "fp2list.jsp?treeid=" + fn.id;
				$("#mainFrame").attr("src", firstSrc);
			}
		});
	});

	//初始化回收站树形菜单
	$(function(){
		var url = '<%=path%>/menu.do';
		$('#recycleTree').tree({
			url: '<%=path%>/js/recycleTreeFp2.json',
			onClick:function(node){
				var src = "recycleFp2list.jsp";
				$("#mainFrame").attr("src", src);
			},
			onLoadSuccess:function(){
				$('#recycleTree').tree("expandAll");
			}
		});
	});

	//打开菜单编辑窗口
	function openMenuWindow(menuType, showTitle){
		$('#menuWindow').dialog({  
			title: showTitle,  
			width: 475,
			height: 400,
			closed: false,  
			cache: false,   
			modal: true,
			onClose:function(){}
		});
		$("#menuFrame").attr("src", "menulist.jsp?menutype=" + menuType);
	}

	//刷新树形菜单
	function reLoadTree(treeId){
		$('#' + treeId).tree('reload');
	}
	</script>
	<style type="text/css">
		body,td,th,div{
 			font-size:12px;
		}
	</style>
  </head>
  
  <body style="margin:0;padding:0" class="easyui-layout">
	<div data-options="region:'west',title:'',border:false" style="width:130px;padding:0px;">
		<div class="easyui-accordion" data-options="fit:true,border:true">
			<div title="供应商发票分类管理"  style="padding:0px;">
				<table border="0" bordercolor="red" height="100%" style="padding-top:0px;">
					<tr><td style="padding-top:0px;">
						<div  style="background-color:#FFFFFF;width:120px;height:100%">
							<ul id="fp2Tree" class="easyui-tree"></ul>
						</div>						
					</td></tr>
					<tr height="25px" align="center" style="text-align:center"><td>		
					<%if("admin".equalsIgnoreCase(users.getUsername())){
					%>				
						<a href="javascript:openMenuWindow('fp2', '修改供应商发票分类')" class="easyui-linkbutton">修改</a><a href="javascript:reLoadTree('fp2Tree')" class="easyui-linkbutton">刷新</a>
					<%	
					}%>
					</td></tr>				
				</table>
			</div>
			<%if("admin".equalsIgnoreCase(users.getUsername())){
			%>
			<div title="回收站"  style="padding:0px;">
				<ul id="recycleTree" class="easyui-tree"></ul>
			</div>
			<%	
			}%>
		</div>		
	</div>
	<div data-options="region:'center',border:false" style="overflow:hidden;">
		<iframe id="mainFrame" name="mainFrame" frameborder="0" src="" width="100%" height="100%" scrolling="no"></iframe>
	</div>
	
	<!-- 修改汇款明细分类面板 -->
	<div id="menuWindow" class="easyui-dialog" closed="true" data-options="buttons:'#buttonsMenuWindow'" style="padding-top:0px;padding-right:0px;overflow:hidden;">
	    <iframe id="menuFrame" name="menuFrame" frameborder="0" src="" width="100%" height="100%" scrolling="no"></iframe>
	</div>
	<div id="buttonsMenuWindow" style="display:none">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#menuWindow').dialog('close');">关闭</a>
	</div>
	
  </body>
</html>
